package zzzhc.image.recognize.nn;

import java.util.ArrayList;
import java.util.List;

public class TestResult {

	private int total;

	private int successNum;

	private List<Entry> result = new ArrayList<Entry>();

	private static class Entry {
		char desire;

		char result;
	}

	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append("TestResult[total=").append(total);
		sb.append(",successNum=").append(successNum);
		sb.append("\n");
		int index = 0;
		for (Entry entry : result) {
			sb.append(index++).append("\t");
			sb.append("desire=").append(entry.desire).append(",");
			sb.append("result=").append(entry.result).append("\n");
		}
		sb.append("]\n");
		return sb.toString();
	}

	public void addResult(char desireChar, char resultChar) {
		Entry entry = new Entry();
		entry.desire = desireChar;
		entry.result = resultChar;
		result.add(entry);
	}

	public char getDisireChar(int index) {
		return result.get(index).desire;
	}

	public char getResultChar(int index) {
		return result.get(index).result;
	}

	public int getSuccessNum() {
		return successNum;
	}

	public void setSuccessNum(int successNum) {
		this.successNum = successNum;
	}

	public int getTotal() {
		return total;
	}

	public void setTotal(int total) {
		this.total = total;
	}

}
